package com.jk.controller;

import com.jk.entity.ItypeEntity;
import com.jk.entity.SqjfEntity;
import com.jk.entity.UserEntity;
import com.jk.entity.XsjfEntity;
import com.jk.service.SqjfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("Sq")
public class SqjfController {

    @Autowired
    private SqjfService service;

    @RequestMapping("getItemList")
    @ResponseBody
    public List<XsjfEntity> getItemListWithOutContentAndItemTypeList(Integer typeID){
        return service.getItemListWithOutContentAndItemTypeList(typeID);
    }



    @RequestMapping("getTypeList")
    @ResponseBody
    public List<ItypeEntity> getTypeList(){
        return service.getTypeList();
    }



    @RequestMapping("getjfId")
    @ResponseBody
    public XsjfEntity getjfId(Integer id, HttpServletRequest request){
        return service.getjfId(id,request);
    }



    @RequestMapping("del")
    @ResponseBody
    public void del(Integer id){
          service.del(id);
    }


    @RequestMapping("add")
    @ResponseBody
    public String add(XsjfEntity xsjfEntity,HttpServletRequest request){
          service.add(xsjfEntity,request);
          return "";
    }


    @RequestMapping("getById")
    @ResponseBody
    public SqjfEntity getById(Integer id){
       return service.getById(id);
    }


    @RequestMapping("getUserList1")
    @ResponseBody
    public List<UserEntity> getUserList1(){
        return service.getUserList1();
    }



    @RequestMapping("getaddupList")
    @ResponseBody
    public List<SqjfEntity> getaddupList(){
        return service.getaddupList();
    }


}
